package com.huas.mapper;

import com.huas.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface LoginMapper {

    @Update("alter table user AUTO_INCREMENT = 1")
    void autoIncrement();

    @Insert("insert into user (account, password,name,avatar,role_id,email) " +
            "values (#{account},#{password},#{name},#{avatar},#{roleId},#{email})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void register(User user);

    @Select("select id,account,password,name,avatar,role_id,email from user where account = #{account}")
    User findByAccount(String account);



}
